fpattern = '/data/CDI/cSAXS_sxdm_2010_02_partial_coherence/analysis/S%05d/S%05d_data_128x128.h5'
d = []
for s in range(1712, 1729):
    d.append(io.h5read(fpattern % (s,s))['data'])
tr = [dd.sum(axis=-1).sum(axis=-1) for dd in d]
dd = np.array(d)
dd1 = dd.sum(axis=-1)
dd0 = dd.sum(axis=-2)
tr = dd0.sum(axis=-1)
x = arange(128)
dx = (dd0*x).sum(axis=-1) / tr
dy = (dd1*x).sum(axis=-1) / tr
figure(3); imshow(dx); axis('tight')
figure(4); imshow(dy); axis('tight')

